home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / gamma-bros.swf / scripts / __Packages / classes / misc / LaserBoost.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  1.3 KB  |  47 lines

  1. class classes.misc.LaserBoost
  2. {
  3.    var cMax;
  4.    var c = 0;
  5.    var c2 = 0;
  6.    var c2Max = 20;
  7.    var Name = "laserBoost";
  8.    function LaserBoost(max)
  9.    {
  10.       this.cMax = max;
  11.       _root.laserPower = 16;
  12.    }
  13.    function main()
  14.    {
  15.       this.c = this.c + 1;
  16.       _root.laserPower = random(300) <= this.c - 50 ? 8 : 16;
  17.       if(this.c == this.cMax)
  18.       {
  19.          _root.laserPower = 8;
  20.          _root.currentBoost = "";
  21.          _root.removePowerUp("laserBoost");
  22.       }
  23.       if(this.c < this.cMax / 3 && _root[_root.char].fire)
  24.       {
  25.          this.c2 = this.c2 + 1;
  26.          this.c2Max /= 1.04;
  27.          if(this.c2 >= Math.ceil(this.c2Max) + 1)
  28.          {
  29.             _root["gunSmoke" + this.c] = new classes.fx.GunSmoke(_root[_root.char].shotX,_root[_root.char].shotY,this.c);
  30.             _root.addFX("gunSmoke" + this.c);
  31.             this.c2 = 0;
  32.          }
  33.       }
  34.       else if(this.c > this.cMax / 3 && _root[_root.char].fire)
  35.       {
  36.          this.c2 = this.c2 + 1;
  37.          this.c2Max *= 1.03;
  38.          if(this.c2 >= Math.ceil(this.c2Max) + 1)
  39.          {
  40.             _root["gunSmoke" + this.c] = new classes.fx.GunSmoke(_root[_root.char].shotX,_root[_root.char].shotY,this.c);
  41.             _root.addFX("gunSmoke" + this.c);
  42.             this.c2 = 0;
  43.          }
  44.       }
  45.    }
  46. }
  47.